package com.teach.config;

// import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
// import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.teach.config.interceptors.AuthInterceptor;
import com.teach.config.interceptors.JWTInterceptor;

// import java.util.List;

import javax.annotation.Resource;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2022-07-13 10:09
 * Version : 1.0
 * Copyright 2022 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
@Configuration
public class MVCConfig implements WebMvcConfigurer {

  @Resource
  private JWTInterceptor jwtInterceptor;

  @Resource
  private AuthInterceptor authInterceptor;

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(jwtInterceptor).addPathPatterns("/**").order(1);
    registry.addInterceptor(authInterceptor).addPathPatterns("/**").order(2);
  }

}
